package cn.datawin.spider;

import cn.datawin.spider.httputil.HttpClientService;
import cn.datawin.spider.httputil.HttpRequest;
import cn.datawin.spider.page.Page;
import cn.datawin.spider.scheduler.PageQueue;

public class CC58 {
	
	static void aa(){

		CCMan cc = new CCMan();
		PageQueue pageQueue = new PageQueue();
		Page p = new Page();
		p.setHttpService(new HttpClientService());
		HttpRequest req = new HttpRequest("http://m.58.com/bj/zufang/18034663527559x.shtml?ad_id=6501191&ecspm=0jYQFhnqnWRKP17jE1RKE1NLPNFAEbEzn1bvEH77rHTYnjI7rjcQPjTzPjNLP1EYPjnL");
//		req.setHeader("User-Agent", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16");
//		req.setHeader("Referer", "http://m.58.com/bj/zufang/?from=home_house_3");
//		req.setHeader("host", "	m.58.com");
//		Map<String, String> headerMap = new HashMap<String, String>(); 
//    	headerMap.put("Accept-Charset", "GBK,utf-8;q=0.7,*;q=0.3");
//      headerMap.put("Accept-Encoding", "gzip,deflate,sdch");
//      headerMap.put("Accept-Language", "zh-CN,zh;q=0.8");
//    	req.setHeaders(headerMap);
    	req.setHeader("Accept-Charset", "GBK,utf-8;q=0.7,*;q=0.3");
		req.setHeader("Accept-Encoding", "gzip,deflate,sdch");
		req.setHeader("Accept-Language", "zh-CN,zh;q=0.8");
		p.setHttpRequest(req);
		pageQueue.offer(p);
		
		/**
		 * 添加Queue
		 */
		 //addQueue(pageQueue);
		
		cc.setPageQueue(pageQueue);
		cc.thread(1, 1, 1).start();
	
	}
	
	public static void main(String[] args) {
		aa();
	}

}
